home *** CD-ROM | disk | FTP | other *** search
- Path: mail2news.demon.co.uk!genesis.demon.co.uk
- From: Lawrence Kirby <fred@genesis.demon.co.uk>
- Newsgroups: comp.lang.c
- Subject: Re: Determining the length of an int in string form
- Date: Sun, 24 Mar 96 21:35:45 GMT
- Organization: none
- Message-ID: <827703345snz@genesis.demon.co.uk>
- References: <3146D058.DD7@cbm.com> <4i7uth$qph@inet-nntp-gw-1.us.oracle.com> <DoE38u.GIH@iquest.net> <4in1ga$ogk@airdmhor.gen.nz> <Pine.SOL.3.91.960319172332.4535A-100000@darwin.UCSC.EDU> <314F65D3.6A8@oc.com>
- Reply-To: fred@genesis.demon.co.uk
- X-NNTP-Posting-Host: genesis.demon.co.uk
- X-Newsreader: Demon Internet Simple News v1.27
- X-Mail2News-Path: genesis.demon.co.uk
-
- In article <314F65D3.6A8@oc.com> lfw@oc.com "Larry Weiss" writes:
-
- >I've seen some suggestions to try to fprintf() once to a file (maybe a
- >"bit-bucket") to get a handle on how many characters sprintf() may use,
- >but I don't think that that's guaranteed by the C Standard to absolutely
- >correspond.
-
- I think it must. 7.9.6.5:
-
- "The sprintf function is equivalent to fprintf, except that the argument s
- specifies an array into which the generated output is to be written,
- rather than to a stream."
-
- So the same number of characters are being written/output in both cases,
- unless a write error occurred in fprintf which you can detect.
-
- --
- -----------------------------------------
- Lawrence Kirby | fred@genesis.demon.co.uk
- Wilts, England | 70734.126@compuserve.com
- -----------------------------------------
-